package sicnu.cs.ich.api.domain.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;


/**
 * @author 黎琦
 * @date 2021-11-25 21:59
 */
@Data
@TableName("t_activities")
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class Activities implements Serializable {

  @TableId(type = IdType.AUTO)
  @NotNull(message = "活动id不能为空")
  private Integer id;
  @NotNull(message = "name不能为空")
  private String name;
  private Integer isCallUpon;
  private Integer userId;
  @NotNull(message = "content不能为空")
  private String content;
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @NotNull(message = "活动开始时间不能为空")
  private Date activityStartTime;
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date activityCreateTime;

  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  @NotNull(message = "活动结束时间不能为空")
  private Date activityEndTime;

  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private Date callCreateTime;

  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
//  @NotNull(message = "号召截止时间不能为空")
  private Date callEndTime;
  @NotNull(message = "regionCode不能为空")
  private Integer regionCode;
  @NotNull(message = "regionDetail不能为空")
  private String regionDetail;
  private Integer likeNum;
  @NotNull(message = "maxNum不能为空")
  private Integer maxNum;
  @NotNull(message = "minNum不能为空")
  private Integer minNum;

  private Integer status;
  private String imgUrl;
  private Integer isEnd;
}
